﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using T.FAS.Runtime.Action.SPI;

namespace T.FAS.Runtime.Action.Engine
{
    /// <summary>
    /// 应用调试返回结果类
    /// </summary>
    [Serializable]
    [DataContract]
    public class CDOActionUtil 
    {
        public static CDOActionBusinessType ConvertToCDOActionBusinessType(string method)
        {
            var methodName = method.ToLower();
            switch (methodName)
            {
                case "savedataforcdo":
                    return CDOActionBusinessType.Add;
                case "deletedataforcdo":
                    return CDOActionBusinessType.Delete;
                case "updatedataforcdo":
                    return CDOActionBusinessType.Update;
                case "querydatabyidforcdo":
                    return CDOActionBusinessType.GetDataByID;
                case "batchdeletedataforcdo":
                    return CDOActionBusinessType.BatchDelete;
                case "batchupdatedataforcdo":
                    return CDOActionBusinessType.BatchUpdate;
                case "querydatalistforcdo":
                default:
                    return CDOActionBusinessType.QueryList;
            }
        }
    }
}
